package org.zyl.oss.general;

/**
 * 阿里云OSS文件类型
 * @author yzzhouyalei@foxmail.com
 * @time 2016年11月22日下午3:28:47
 */
public enum GeneralOssObjectContentTypeEnum {
	DOC("doc","application/msword"),
	DOCX("docx","application/msword"),
	PPT("ppt","application/vnd.ms-powerpoint"),
	PPTX("pptx","application/vnd.ms-powerpoint"),
	TXT("txt","text/plain"),
	BMP("bmp","image/bmp"),
	JPEG("jpeg","image/jpeg"),
	JPG("jpg","image/jpeg"),
	GIF("gif","image/gif"),
	PNG("png","image/png"),
	APK("apk","application/vnd.android.package-archive");
	private String code;
	private String text;
	private GeneralOssObjectContentTypeEnum(String code,String text){
		this.code = code;
		this.text = text;
	}
	public static String getText(String code){
		for (GeneralOssObjectContentTypeEnum e : GeneralOssObjectContentTypeEnum.values()) {
			if (e.getCode().equals(code)) {
				return e.getText();
			}
		}
		return "text/xml";
	}
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getText() {
		return text;
	}
	public void setText(String text) {
		this.text = text;
	}

}
